package com.ellricky.tc_manager.ui.home.ammeet

import com.ellricky.baselib.http.callback.ECallback
import com.ellricky.baselib.ui.base.BaseDetailActivity
import com.ellricky.tc_manager.API_AM_MEET_DETAIL
import com.ellricky.tc_manager.AmMeetDetailEntity
import com.ellricky.tc_manager.R
import kotlinx.android.synthetic.main.tm_activity_am_meet_detail.*


class AmMeetDetailActivity : BaseDetailActivity() {

    override fun getChildContentLayout(): Int {
        return R.layout.tm_activity_am_meet_detail
    }


    override fun initUIView() {
        super.initUIView()
        mTvTitle.text = getString(R.string.tm_am_meet_detail)
        loadDetail(id)

    }

    private fun loadDetail(id: String) {
        mPresenter.loadDetail(
                API_AM_MEET_DETAIL, id, object : ECallback<AmMeetDetailEntity>(this) {
            override fun onSuccess(data: AmMeetDetailEntity?, msg: String) {
                data?.let {
                    tvTitle.text = it.meetTitle
                    tvAreaName.text = it.areaName
                    tvFzTeacher.value = it.name
                    tvDate.value = it.meetDate
                    tvContent.text = it.meetInfo
                }
            }
        })

    }
}
